<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>sticky 吸顶</title>
  <style>
    .top, .mid{
      height: 50px;
      background: pink;
    }
    .sticky{
      height: 50px;
      background: red;
      position: sticky;
      top: 0px;
    }
    .sticky1{
      height: 50px;
      background: red;
      position: sticky;
      top: 50px;
    }
    .content{
      background: blue;
      height: 200vh;
    }
  </style>
</head>
<body>
    <div class="container">
      <div class="top">top</div>
      <div class="sticky">121212</div>
      <div class="mid">mid</div>
      <div class="sticky1">343434</div>
      <div class="content">我是内容</div>
    </div>
</body>
</html>